<template>
    <div class="box">
        <div class="top">
            <div class="topList" v-for="(item, index) in newTopdata" :key="index">
                <div class="bjImg">
                    <div class="left">
                        <img src="item.icon" class="imges_1" alt="">
                        <div class="text_1">
                            {{ item.name }}
                        </div>
                    </div>
                    <div class="right">
                        <div class="text_2">
                            <span class="num_1" v-show="item.num.length < 8"> 0</span>{{ item.num }}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="map">
            <Map :markerData="markerData"></Map>
        </div>
        <div class="bottom">
            <div class="bottom_l">
                <div v-for="(item, index) in props.centerDataOne.objC1.dataList" :key="index" class="shebei">
                    <div class="img">
                        <img src="" alt="">
                    </div>
                    <div class="text">{{ item.name }}</div>
                </div>
            </div>
            <div class="bottom_r">
                <div v-for="(item, index) in props.centerDataTwo.objC2.dataList" :key="index" class="shebei">
                    <div class="img">
                        <img src="" alt="">
                    </div>
                    <div class="text">{{ item.name }}</div>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup>
import { computed, onMounted, ref, defineProps } from 'vue'
import dataJson from '@/utils/gg.json'
import Map from '@/components/map1'
const props = defineProps({
    centerDataOne: {
        type: Object,
        default: {}
    },
    centerDataTwo: {
        type: Object,
        default: {}
    }
})
const markerData = computed(() => {
    return (dataJson.features.filter((item) => {
        return item.geometry.type == 'Point'
    }));
});

const newTopdata = computed(() => {
    return (topData.value.map((item) => {
        let newNum = item.num.toString()
        item.num = newNum.split('').join('  ')
        return item
    }))
})

let topData = ref([
    { name: '重点人员数量', num: 1234, icon: '', bjImg: '' },
    { name: '救援人员数量', num: 456, icon: '', bjImg: '' },
    { name: '救援物资数量', num: 789, icon: '', bjImg: '' },
])
onMounted(() => {
})
</script>

<style scoped src="./index.css"></style>